package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;

import java.util.Objects;

public enum RoleTypeEnum implements IEnum<String> {

    all("all", "全部"),
    admin("admin", "管理员"),
    kefu("kefu", "客服"),
    operator("operator", "运营"),
    zhijian("zhijian", "质检"),
    coder("coder", "研发"),
    clerk("clerk", "业务员"),
    zhubo("zhubo", "主播"),
    zhuli("zhuli", "助理"),
    sales("sales", "市场销售"),
    stock("stock", "仓库管理"),

    price("price", "价格维护"),
    caiwu("caiwu", "财务"),
    partner("partner", "外部合作商"),
    partner_stock_sales("partner-stock-sales", "外部合作商-含库存/销售自营"),
    kefuzhuguan("kefuzhuguan", "客服主管"),
    sales_franchisee("sales-franchisee", "市场销售-含加盟商库存管理"),
    aiji("aiji", "爱机库存管理"),
    sales_stock("sales-stock", "市场销售-含查看库存"),
    order_list_view("order_list_view", "订单查看"),;

    ;


    private String value;
    private String desc;

    RoleTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public String value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

    public static String getDesc(Integer value) {
        for (RoleTypeEnum thisEnum : RoleTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }
}
